﻿#include "QWidgetWindowBase.h"
#include "CAppUiConfig.h"

QWidgetWindowBase::QWidgetWindowBase(QWidgetBase *parent)
: QWidgetBase(parent)
{

}

QWidgetWindowBase::~QWidgetWindowBase()
{

}


// 初始化UI
void QWidgetWindowBase::initUI()
{
	QWidgetBase::initUI();
	QRect rect = QApplication::desktop()->availableGeometry();
	resize(rect.width(), rect.height());
	setAutoFillBackground(true);
    QPixmap pixmap;
	QPalette palette;
	palette.setBrush(QPalette::Background,QBrush(pixmap));
	setPalette(palette);

}

// 初始化样式
void QWidgetWindowBase::initStyleSheet()
{
	QWidgetBase::initStyleSheet();
}

// 初始化连接
void QWidgetWindowBase::initConnect()
{
	QWidgetBase::initConnect();
}


void QWidgetWindowBase::paintEvent(QPaintEvent *event)
{
	QWidgetBase::paintEvent(event);
	Q_UNUSED(event);

	QStyleOption opt;
	opt.init(this);
	QPainter p(this);
	style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
	if(m_upSize > 0){
		m_upSize--;
		update();
	}
}
